package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "upload-service")
public interface UploadService {

    /**
     * 声明远程服务接口
     * 1、@PostMapping 必须提供consumes属性，它的值必须是multipart/form-data
     * 2、MultipartFile参数前，必须增加@RequestPart
     */
    @PostMapping(value = "/upload/image",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<String> uploadImage(@RequestPart MultipartFile image) ;
}
